package com.gl.course1;

/**
 * Created by GAOLEI on 2019/7/26.
 */
public class FooTest {

    public static void main(String[] args) {
        Foo foo = new Foo();
        new Thread(()->{
            try {
                foo.first(new A());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }).start();
        new Thread(()->{
            try {
                foo.first(new B());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }).start();
        new Thread(()->{
            try {
                foo.first(new C());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }).start();

    }

    static  class  A implements Runnable{

        public void run() {
            System.out.print("one");
        }
    }
    static class  B implements Runnable{

        public void run() {
            System.out.print("two");
        }
    }
    static class  C implements Runnable{

        public void run() {
            System.out.print("three");
        }
    }

}
